<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>arm demo</title>

    <script src="../js/amrnb.js"></script>
    <script src="../js/libary_amr.js"></script>

</head>
<body>
    <h2>转码 amr 文件和播放</h2>
    <p id="sample-amr">
        <button>播放</button>
        <a href="../source/yuan.amr">yuan.amr</a>
    </p>

    <h2>解码 audio 成 amr 文件并且播放</h2>
    <p id="sample-audio">
        <button>解码audio成amr格式并播放</button>
        <a href="../source/hello.ogg">hello.ogg</a>
    </p>

    <h2>base64格式的语音播放</h2>
    <p id="base64-audio5">
        <button>base64 &amp; Play</button>
    </p>

    <h2>Amr to wav</h2>
    <p id="amr-to-wav">
        <button>Convert to wav and play</button>
        <a href="../source/yuan.amr">yuan.amr</a>
    </p>

    <pre></pre>
    <script>
        onload = function(){
            // decode amr file and play
            E('#sample-amr > button').onclick = function () {
                fetchBlob(E('#sample-amr > a').href, function (blob) {
                    playAmrBlob(blob);
                });
            };

            E('#sample-audio > button').onclick = function () {
                fetchBlob(E('#sample-audio > a').href, function (blob) {
                    convertAudioBlobToAmr(blob);
                });
            };

            E('#amr-to-wav > button').onclick = function () {
                fetchBlob(E('#amr-to-wav > a').href, function (blob) {
                    convertAmrBlobToWav(blob);
                });
            };

            E('#base64-audio5 > button').onclick = function () {
                playAmrToWav(base64Str);
            };

            var base64Str = 'IyFBTVIKLEWGYIDYAbvFOH2GfsiOIegRLMIqLEkrjgtAHkTQivDmfVM1jaNZEngILE2GwAPEmHx5NDk7pUNLUfWYUsHoLEgkjgtMXPPQwhrzXi7BBeVsCTl8LCwkwAeF+DQZtU6aHy/oi85xm48+LEQZTg8IfgSxFs8MTWkmTJnCiVeQLAmWQA8DcwJqRyWK6D1JXNiGT1/kLCCtjhwg/i4HQxYBTh/FyL0c4PKGLEOUnB8ECWzBtivj/o0uCKBOSVwaLERviBwjOO1SQyDHHShqp6v5ntQ6LIK0jpaN20m16Ebxbex+FST/0L6cLESbnFiime8ELtBDikj7R/v6kpIGLJAYHB7i/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